package com.global.emc.spring.security.core.userdetails.jdbc;

import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

/**   
 *  
 * @Description:  [数据库访问UserDetails]   
 * @Author:       [Joly_Huang]   
 * @CreateDate:   [2014年2月18日 下午1:11:58]   
 * @UpdateUser:   [Joly_Huang]   
 * @UpdateDate:   [2014年2月18日 下午1:11:58]   
 * @UpdateRemark: [说明本次修改内容]  
 * @Version:      [v1.0] 
 *    
 */
public class DatabaseUserDetailsService implements UserDetailsService{
	
	private DatabaseUserDetailsDAO databaseUserDetailsDAO;

	public DatabaseUserDetailsDAO getDatabaseUserDetailsDAO() {
		return databaseUserDetailsDAO;
	}
	public void setDatabaseUserDetailsDAO(
			DatabaseUserDetailsDAO databaseUserDetailsDAO) {
		this.databaseUserDetailsDAO = databaseUserDetailsDAO;
	}

	public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
		return databaseUserDetailsDAO.loadUserByUsername(username);
	}

}
